<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <p>请选择你喜欢的栏目</p>
        <span v-for="item in list">
            <!-- 不能写死的属性用什么指令？v-bind: 简写为: -->
            <input v-model="chkList" :value="item"  type="checkbox"> {{ item }}
        </span>

        <p>以下是你所选的项目：</p>
        <ul>
            <li v-for="item in chkList">
                {{ item }}
            </li>
        </ul>
    </div>

    <script src="./vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                list: ["科幻", "喜剧", "动漫", "冒险", "科技", "军事", "娱乐", "奇闻"],
                // 用来保存选中的数组
                chkList: []
            }
        })
    </script>
</body>

</html>